<?php

namespace app\admin\model\fm;

use think\Model;

/**
 * Gltrans
 */
class Gltrans extends Model
{
    // 表主键
    protected $pk = 'counterindex';
    
    // 表名
    protected $name = 'fm_gltrans';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function typeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Systypes::class, 'type', 'typeid');
    }

    public function periodnoTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Periods::class, 'periodno', 'periodno');
    }

    public function accountTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'account', 'accountcode');
    }

    public function tagTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Tags::class, 'tag', 'tagref');
    }
}